package com.ourcraft.informationcollectionsystem.utils.response;

/**
 * 后端返回前端的结果状态码
 *
 * @author Z0136
 * @since 2023/10/29
 */
public enum ResultCode {
    SUCCESS(200, "成功"),
    FAIL(400, "失败"),
    UNATUTHORIZED(401, "无访问权限"),
    TOKEN_EXPIRED(402, "登录过期"),
    NOT_FOUND(404, "接口不存在"),
    INTERNAL_SERVER_ERROR(500, "系统繁忙");

    private final Integer code; // 状态码
    private final String message; // 状态码描述

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    ResultCode(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
}
